Dictionnaire Rmarkdown

Écrire du code R

On peut insérer une cellule de code R à l’aide de Ctrl + Alt + I (Cmd + Option + I pour macOS).

x<- c(1,2,3,4,5,6)
print(mean(x))
[1] 3.5

Écrire des mathématiques avec Rmarkdown

On peut écrire des symboles mathématiques à l’aide du symbole $. Une expression mathématique doit commencer et terminer par $. Par exemple $\alpha = 0.05\%$ devient \(\alpha = 0.05\%\). Dans la suite de ce dictionnaire se trouve des commandes usuelles pour répondre aux TD et TP.

Mathématiques générales

\(x\)

$x$

\(X\)

$X$

\(A_b\)

$A_b$

\(A^b\)

$A^b$

\(A+B\)

$A+B$

\(A-B\)

$A-B$

\(A\times B\)

$A\times B$

\(\frac{A}{B}\)

$\frac{A}{B}$

\(X_i\)

$X_i$

\((x_1,\dots,x_n)\)

$(x_1,\dots,x_n)$

\((X_1,\dots,X_n)\)

$(X_1,\dots,X_n)$

Théorie des tests

\(\alpha\)

$\alpha$

\(\beta\)

$\beta$

\(\mu\)

$\mu$

\(\mu = \mathbb{E}[X]\)

$\mu = \mathbb{E}[X]$

\(\sigma\)

$\sigma$

\(\sigma^2\)

$\sigma^2$

\(\sigma^2 = \mathbb{V}[X]\)

$\sigma^2 = \mathbb{V}[X]$

\(X \sim \mathcal{N}(\mu,\sigma^2)\)

$X \sim \mathcal{N}(\mu,\sigma^2)$

\(\bar{X}_n\)

$\bar{X}_n$

\(\sum_{i=1}^n X_i\)

$\sum_{i=1}^n X_i$

\(\bar{X}_n = \frac{1}{n}\sum_{i=1}^n X_i\)

$\bar{X}_n = \frac{1}{n}\sum_{i=1}^n X_i$

\(S^2 = \frac{1}{n-1} \sum_{i=1}^n (X_i-\bar{X}_n)^2\)

$S^2 = \frac{1}{n-1} \sum_{i=1}^n (X_i-\bar{X}_n)^2$

\(H_0\)

$H_0$

\(H_1\)

$H_1$

\(\mu=\mu_0\)

$\mu=\mu_0$

\(\mu>\mu_0\)

$\mu>\mu_0$

\(\mu\geq\mu_0\)

$\mu\geq\mu_0$

\(\mu<\mu_0\)

$\mu<\mu_0$

\(\mu\leq\mu_0\)

$\mu\leq\mu_0$

\(\mu\neq\mu_0\)

$\mu\neq\mu_0$

\(\alpha = 0.05\%\)

$\alpha = 0.05\%$

\(\mathbb{P}(A)\)

$\mathbb{P}(A)$

\(\mathbb{P}(\mu \in IC)\)

$\mathbb{P}(\mu \in IC)$

\(\sqrt{n}\)

$\sqrt{n}$

\(\sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \sim \mathcal{N}(0,1)\)

$\sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \sim \mathcal{N}(0,1)$

\(\sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \sim T(n-1)\)

$\sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \sim T(n-1)$

\(\mathbb{P}(\sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \leq q_{1-\alpha} )= 1-\alpha\)

$\mathbb{P}(\sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \leq q_{1-\alpha} )= 1-\alpha$

\(\mathbb{P}(q_{1-\alpha/2} \leq \sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \leq q_{1-\alpha/2} )= 1-\alpha\)

$\mathbb{P}(q_{1-\frac{\alpha}{2}} \leq \sqrt{n}\frac{(\bar{X}_n-\mu)}{S} \leq q_{1-\frac{\alpha}{2}} )= 1-\alpha$

\(IC_{\alpha}(\mu) = [\bar{X}_n-\frac{S}{\sqrt{n}} q_{1-\frac{\alpha}{2}} ,\bar{X}_n+\frac{S}{\sqrt{n}} q_{1-\frac{\alpha}{2}}]\)

$IC_{\alpha}(\mu) = [\bar{X}_n-\frac{S}{\sqrt{n}} q_{1-\frac{\alpha}{2} ,\bar{X}_n+\frac{S}{\sqrt{n}} q_{1-\frac{\alpha}{2}]$

\([\bar{x}_n-\frac{s}{\sqrt{n}} q_{1-\frac{\alpha}{2}} ,\bar{x}_n+\frac{s}{\sqrt{n}} q_{1-\frac{\alpha}{2}}]=[73.37;75.47]\)

$[\bar{x}_n-\frac{s}{\sqrt{n}} q_{1-\frac{\alpha}{2}} ,\bar{x}_n+\frac{s}{\sqrt{n}} q_{1-\frac{\alpha}{2}}]=[73.37;75.47]$

\(p_c=\mathbb{P}_{H_0}(|T_n|>|t_n|)\)

$p_c=\mathbb{P}_{H_0}(|T_n|>|t_n|)$

Modèles linéaires

\(E_i \overset{i.i.d.}\sim \mathcal{N}(0,\sigma^2)\)

$E_i \overset{i.i.d.}\sim \mathcal{N}(0,\sigma^2)$

\(Y_i = \beta + \sum_{j=1}^p\alpha_j x_{i,j} + E_i, \quad E_i\overset{i.i.d.}\sim{\cal N}(0,\sigma^2)\)

$Y_i = \beta + \sum_{j=1}^p\alpha_j x_{i,j}    + E_i, \quad E_i\overset{i.i.d.}\sim{\cal N}(0,\sigma^2)$

\(Y=X\theta+E\)

$Y=X\theta+E$

\(Y =\begin{bmatrix} Y_1\\ Y_2\\ \vdots \\ Y_n\end{bmatrix}\)

$Y =\begin{bmatrix} 
    Y_1   \\
    Y_2   \\
    \vdots\\
    Y_n
    \end{bmatrix}$

\(X = \begin{bmatrix}1 & x_{1,1} & \ldots & x_{p, 1}\\1 & x_{1, 2} & \ldots & x_{p, 2}\\\vdots & \vdots & & \vdots \\1 & x_{1, n} & \ldots & x_{p, n}\end{bmatrix}\)

$X = \begin{bmatrix}
1      & x_{1,1}  & \ldots & x_{p, 1}\\
1      & x_{1, 2} & \ldots & x_{p, 2}\\
\vdots & \vdots   &        & \vdots  \\
1      & x_{1, n} & \ldots & x_{p, n}
\end{bmatrix}$

\(\theta = \begin{bmatrix} \beta\\ \alpha_1\\\alpha_2\\ \vdots \\ \alpha_{p}\end{bmatrix}\)

$\theta = \begin{bmatrix} 
          \beta   \\
          \alpha_1\\
          \alpha_2\\
          \vdots  \\
          \alpha_{p}
          \end{bmatrix}$

\(E = \begin{bmatrix}E_1\\E_2\\ \vdots \\ E_n\end{bmatrix}\)

$E = \begin{bmatrix}
      E_1    \\
      E_2    \\
      \vdots \\
      E_n
      \end{bmatrix}$

\(E \sim \mathcal{N}\left(\vec{0}_n,\,\sigma^2 I_n\right)\)

 $E \sim \mathcal{N}\left(\vec{0}_n,\,\sigma^2 I_n\right)$